
//连接数据库
var mysql = require('mysql');
var connection = mysql.createConnection({
    host: 'bdm253137448.my3w.com', //数据库地址
    user: 'bdm253137448',   //数据库用户名
    password: 'muchengfeng123', //数据库管理密码
    database:'bdm253137448_db', //数据库名称
    insecureAuth: true
});

connection.connect(function(err) {
    if (err) {
        console.error('error connecting: ' + err.stack);
        return;
    }

    console.log('connected as id ' + connection.threadId);
});


var  userAddSql ="INSERT INTO person(id,name,age,info) VALUES(3, '学霸',23,'喜欢'),(4, '妍妍',24,'号iiii')";

//增 add
connection.query(userAddSql,function (err, result) {
    if(err){
        console.log('[INSERT ERROR] - ',err.message);
        return;
    }
    console.log('INSERT ID:',result);

});
//关闭连接
connection.end();